;const express = require("express");
const db = require("../modules/DBhelper")

let router = express.Router();

router.get("/query", async function (request,response,next) {
try {
  let gid = request.query.ms;

  let sql = "SELECT * FROM `goods` WHERE `g_id` = ? ;";

  let resultQuery = await db.exec(sql,[gid]);

  response.json({ msg: "查询成功", status: 200, data: resultQuery })
}catch(error){
  response.json({ msg: "查询失败", status: -200, error })
}
})

module.exports = {router}